package com.prs.crm.dao.personalset.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.personalset.DefaultCityDao;
import com.prs.crm.domain.personalset.DefaultCity;

public class DefaultCityDaoImpl extends BaseDaoImpl<DefaultCity> implements DefaultCityDao{

	@SuppressWarnings("unchecked")
	@Override
	public List<DefaultCity> getAllDefaultCity() {
		Criteria criteria=this.getSession().createCriteria(DefaultCity.class);
		return criteria.list();
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<DefaultCity> getAllDefaultCityById(Integer proId) {
		Criteria criteria=this.getSession().createCriteria(DefaultCity.class)
		.add(Restrictions.eq("defaultProvince.id", proId));
		System.out.println(proId);
		return criteria.list();
	}

}
